package pl.com.like.sequoia.model.bio.enums;

public enum PdbDefEnum {

	TITLE("title"), CLASSIFICATION("classification"), TECHNIQUE("technique");

	private String label;

	private PdbDefEnum(String key) {
		label = key;
	}

	private PdbDefEnum defaultValue() {
		return TITLE;
	}

	public PdbDefEnum fromDbValue(String dbValue) {
		for (PdbDefEnum item : values()) {
			if (item.getLabel().equals(dbValue)) {
				return item;
			}
		}
		return defaultValue();
	}

	public String getLabel() {
		return label;
	}

	public String toDbValue() {
		return label;
	}

}
